<?php
$from = (($page - 1) * max_product);
$select = 'name,name_rewrite,url_hinh,company';
$table = 'product';
$where = "`delete`=0 AND status=1 AND menu_id LIKE '%,{$idMenu},%'";
$limit = "LIMIT {$from},".max_product;
$list = $tc->list_item($select,$table,$where,$limit);
$total = mysql_num_rows($list);
if($total > 1){
	$view_post .= '<div class="list_product"><div class="title">'.$row_menu_one['name'].'</div><h1>'.$row_menu_one['title'].'</h1><h2>'.$row_menu_one['metaDescription'].'</h2>';
	while($row = mysql_fetch_array($list)){
		$view_post .= '<div class="item">
			<a href="'.$row_menu_one['url'].$row['name_rewrite'].'.html" title="'.$row['name'].'"><h4>'.$row['name'].'</h4>
			<img src="'.url_product_thumb_image.$row['url_hinh'].'" alt="'.$row['name'].'" /></a>
			<h6>'.$row['company'].'</h6>
		</div>';
	}
	mysql_free_result($list);
	
	$phantrang = $tc->phantrang($row_menu_one['url'],$page,max_news,'id',$table,$where);
	$view_post .= "<div id=\"phantrang\">{$phantrang}</div>";
	$view_post .= '<div style="clear:both; height:10px"></div></div>';
}elseif($total==1){
	$row = mysql_fetch_array($list);
	header('location: http://'.$domain.'/'.$row_menu_one['url'].$row['name_rewrite'].'.html');
}else $view_post = '<div style="padding:20px">Thông tin đang được cập nhật...</div>';



